﻿<?phpfunction getHistory($date){	$date = strtotime($date) ? strtotime($date) : time();	//get path to the history file of today	$year = date('Y', $date);	$month = date('m', $date);	$day = date('d', $date);	$file = 'history/'.$year.'/'.$month.'/'.$day.'.json';	if(!is_file($file)){		return array('no history record found for this date');	}	$history = array_decode(json_decode(@file_get_contents($file), TRUE));	return $history;}function array_decode($array){	foreach($array as $key=>$value){		if(is_array($value)){			$array[$key] = array_decode($value);		}		else{			$array[$key] = base64_decode($value);		}	}	return $array;}?>